<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2016/6/17
 * Time: 16:01
 */
if (isset($arr_data->cmd2)){
    switch ($arr_data->cmd2){
        case 'sell':
            $ret = $game->dj_sub($arr_data->djid,$arr_data->canshu);
            if ($ret){
                $daoju = $game->dj_get_sys($arr_data->djid);
                $卖出游戏币 = $daoju->djyxb * $arr_data->canshu;
                $game->yxb_change(1,$卖出游戏币);
                echo "卖出成功，获得{$卖出游戏币}灵石<br/>";
            }

            break;
    }


}

$retdj = $game->dj_get_all_player();
$链接_道具列表 = "";


if ($retdj){
    $hangshu = 0;
    for ($i=0;$i<count($retdj);$i++){

        if ($retdj[$i]->djsum > 0){
            $hangshu = $hangshu + 1;
            $链接_查看道具 = $game->create_url( "cmd=djinfo&cmd2=djinfo&djid={$retdj[$i]->djid}","{$retdj[$i]->djname}x{$retdj[$i]->djsum}");
            $链接_卖出1 = $game->create_url( "cmd=bagdj&cmd2=sell&canshu=1&djid={$retdj[$i]->djid}","卖出*1");
            $链接_卖出5 = $game->create_url( "cmd=bagdj&cmd2=sell&canshu=5&djid={$retdj[$i]->djid}","卖出*5");
            $链接_卖出10 = $game->create_url( "cmd=bagdj&cmd2=sell&canshu=10&djid={$retdj[$i]->djid}","卖出*10");
            $链接_道具列表 .="{$链接_查看道具}{$链接_卖出1}{$链接_卖出5}{$链接_卖出10}<br/>";
        }

    }
}

$变量_道具列表 = (object)array(
    "链接_道具列表"=>$链接_道具列表

);

$dis_mid = $game->dis_get('排版_道具列表');
eval("\$out_html = \"$dis_mid->dis_string\";");
$out_html = str_replace("<br/><br/>", "<br/>",$out_html);
$out_html = str_replace("<br/><br/>", "<br/>",$out_html);
$out_html = str_replace("</div><br/>", "</div>",$out_html);
echo $out_html;